package com.example.sty.service.impl;


import com.example.sty.mapper.UserMapper;
import com.example.sty.service.UserService;
import com.example.sty.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    /**
     * 登录
     *
     * @param username
     * @param password
     * @return
     */
    @Override
    public User login(String username, String password) {
        return userMapper.login(username, password);
    }

    /**
     * 注册
     *
     * @param username
     * @param password
     * @param roleId
     */
    @Override
    public void register(String username, String password, String roleId) {
        userMapper.register(username, password, roleId,"0");
    }
}
